﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Viki_BllFactory;
using Viki_IBll;
using Viki_Bll;

namespace Viki1
{
    public partial class Register : System.Web.UI.Page
    {
        IUserService us = Viki_BllFactory.DataAccess.CreateUserService();
        IRegisterService rs = Viki_BllFactory.DataAccess.CreateRegisterService();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void submit_Click(object sender, EventArgs e)
        {
            if (us.findUser(email.Text, password.Text))
                Response.Write("<script language='javascript'>alert('该用户名已经存在')</script>");
            else
            {
                DateTime now = DateTime.Now;
                rs.add(email.Text, password.Text, mobile.Text, tj_code.Text, now);
                Response.Write("<script language='javascript'>alert('注册成功！')</script>");
                Response.Redirect("Register.aspx");
            }
        }

     
        
           

        }
     
}